 /**
   * Copyright 2014 Viettel Telecom. All rights reserved.
   * VIETTEL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   */
 package com.viettel.core.bussiness.cms; 
import java.util.List; 

import org.springframework.beans.factory.annotation.Autowired; 

import com.viettel.core.exceptions.BusinessException; 
import com.viettel.core.exceptions.DataAccessException; 
import com.viettel.core.dao.cms.TechniqueCategoryDAO;
import com.viettel.core.entities.cms.TechniqueCategory;
import com.viettel.core.entities.vo.TechniqueCategorySearchFilter;
import com.viettel.core.entities.vo.TechniqueCategorySearchVO;
 /**
   *  Mo ta muc dich cua lop (interface)
   *  @author: TOANTM1
   *  @version:  
   *  @since: 27/02/2014 - 11:34:02
   */
 public class TechniqueCategoryMgrImpl implements TechniqueCategoryMgr{ 
	@Autowired 
	TechniqueCategoryDAO techniquecategoryDAO; 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public TechniqueCategory getTechniqueCategoryById(Integer id) throws BusinessException { 
		try { 
			return  techniquecategoryDAO.getTechniqueCategoryById(id); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public TechniqueCategory createTechniqueCategory(TechniqueCategory techniquecategory) throws BusinessException { 
		try { 
			return techniquecategoryDAO.createTechniqueCategory(techniquecategory); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void updateTechniqueCategory(TechniqueCategory techniquecategory) throws BusinessException { 
		try { 
			techniquecategoryDAO.updateTechniqueCategory(techniquecategory); 
		} catch (DataAccessException e) {	 
			throw new BusinessException(e); 
		} 
	} 
 
 	/**@author TOANTM1
  	 * 27/02/2014 - 11:34:02
  	 * For: 
  	 * @description: 
  	 */
 	@Override 
	public void deleteTechniqueCategory(TechniqueCategory techniquecategory) throws BusinessException { 
		try { 
			techniquecategoryDAO.deleteTechniqueCategory(techniquecategory); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

 	/**
 	 * @author tuantm20
 	 * @param parentId
 	 * @return
 	 * @throws BusinessException
 	 */
	@Override
	public List<TechniqueCategory> getListParentTechniqueCategory(Integer parentId) throws BusinessException {
		try { 
			return techniquecategoryDAO.getListParentTechniqueCategory(parentId); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	/**
 	 * @author tuantm20
 	 * @return
 	 * @throws BusinessException
 	 */
	@Override
	public List<TechniqueCategory> getAllTechniqueCategory() throws BusinessException {
		try { 
			return techniquecategoryDAO.getAllTechniqueCategory(); 
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	} 
	
	/**
 	 * @author tuantm20
 	 * @param parentId
 	 * @return
 	 * @throws BusinessException
 	 */
	@Override
	public List<TechniqueCategory> getListTechniqueCategoryByParentId(Integer parentId) throws BusinessException {
		try { 
			return techniquecategoryDAO.getListTechniqueCategoryByParentId(parentId);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	/**
 	 * @author tuantm20
 	 * @param parentId
 	 * @return
 	 * @throws BusinessException
 	 */
	@Override
	public List<TechniqueCategorySearchVO> getListTechniqueCategoryByFilter(TechniqueCategorySearchFilter filter) throws BusinessException {
		try { 
			return techniquecategoryDAO.getListTechniqueCategoryByFilter(filter);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		} 
	}

	@Override
	public List<TechniqueCategory> getListTechniqueCategoryNotParent()
			throws BusinessException {
		try { 
			return techniquecategoryDAO.getListTechniqueCategoryNotParent();
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		}
	}
	@Override
	public List<TechniqueCategory> getListTechniqueCategoryParent() throws BusinessException{
		try { 
			return techniquecategoryDAO.getListTechniqueCategoryParent();
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		}
	}
	@Override
	public Boolean checkNameExist(String userName) throws BusinessException{
		try { 
			return techniquecategoryDAO.checkNameExist(userName);
		} catch (DataAccessException e) { 
			throw new BusinessException(e); 
		}
	}
 	
} 
